<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>4_2_2-2-绑定监听方法</title>
</head>

<body>


  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  <div id="Application">

    <div @mousedown.ctrl="mousedown">用户按下Ctrl键的同时，再按下鼠标按键才会触发绑定的事件函数 </div>
    <input placeholder="用户按下Alt键的同时，再按回车键才会触发绑定的事件函数" size="60" @keyup.alt.enter="keyup"></input>

    <div @mousedown.ctrl.exact="mousedown">只有用户按下Ctrl键的同时，再按下鼠标按键才会触发绑定的事件函数</div>
  </div>
  <script>
    const App = {
      data() {
        //返回对象
        return {};
      },

      methods: {
        mousedown() {
          console.log("鼠标按下啦");
        },
        keyup() {
          console.log("keyup触发啦")
        }
      },
    };
    Vue.createApp(App).mount("#Application");
  </script>
</body>

</html>